home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 3 / ct-rom iiib.zip / ct-rom iiib / WINDOWS / DIVERSEN / WINE02BX / EMACS.7 < prev    next >
Text File  |  1993-03-28  |  51KB  |  1,226 lines

  1. Info file ../info/emacs, produced by Makeinfo, -*- Text -*- from input
  2. file lemacs.tex.
  3.  
  4.    This file documents the GNU Emacs editor.
  5.  
  6.    Copyright (C) 1985, 1986, 1988 Richard M. Stallman.  Copyright (C)
  7. 1991, 1992 Lucid, Inc.
  8.  
  9.    Permission is granted to make and distribute verbatim copies of
  10. this manual provided the copyright notice and this permission notice
  11. are preserved on all copies.
  12.  
  13.    Permission is granted to copy and distribute modified versions of
  14. this manual under the conditions for verbatim copying, provided also
  15. that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
  16. General Public License" are included exactly as in the original, and
  17. provided that the entire resulting derived work is distributed under
  18. the terms of a permission notice identical to this one.
  19.  
  20.    Permission is granted to copy and distribute translations of this
  21. manual into another language, under the above conditions for modified
  22. versions, except that the sections entitled "The GNU Manifesto",
  23. "Distribution" and "GNU General Public License" may be included in a
  24. translation approved by the author instead of in the original English.
  25.  
  26. 
  27. File: emacs,  Node: Several Buffers,  Prev: Kill Buffer,  Up: Buffers
  28.  
  29. Operating on Several Buffers
  30. ============================
  31.  
  32.    The "buffer-menu" facility is like a "Dired for buffers"; it allows
  33. you to request operations on various Emacs buffers by editing a buffer
  34. containing a list of them.  You can save buffers, kill them (here
  35. called "deleting" them, for consistency with Dired), or display them.
  36.  
  37. `M-x buffer-menu'
  38.      Begin editing a buffer listing all Emacs buffers.
  39.  
  40.    The command `buffer-menu' writes a list of all Emacs buffers into
  41. the buffer `*Buffer List*', and selects that buffer in Buffer Menu
  42. mode.  The buffer is read-only.  You can only change it using the
  43. special commands described in this section.  Most of the commands are
  44. graphic characters.  You can use  Emacs cursor motion commands in the
  45. `*Buffer List*' buffer.  If the cursor is on a line describing a
  46. buffer, the following  special commands apply to that buffer:
  47.  
  48. `d'
  49.      Request to delete (kill) the buffer, then move down.  A `D' before
  50.      the buffer name on a line indicates a deletion request.  Requested
  51.      deletions actually take place when you use the `x' command.
  52.  
  53. `k'
  54.      Synonym for `d'.
  55.  
  56. `C-d'
  57.      Like `d' but move up afterwards instead of down.
  58.  
  59. `s'
  60.      Request to save the buffer.  An `S' befor the buffer name on a
  61.      line indicates the request.  Requested saves actually take place
  62.      when you use the `x' command.  You can request both saving and
  63.      deletion for the same buffer.
  64.  
  65. `~'
  66.      Mark buffer "unmodified".  The command `~' does this immediately
  67.      when typed.
  68.  
  69. `x'
  70.      Perform previously requested deletions and saves.
  71.  
  72. `u'
  73.      Remove any request made for the current line, and move down.
  74.  
  75. `DEL'
  76.      Move to previous line and remove any request made for that line.
  77.  
  78.    All commands that add or remove flags to request later operations
  79. also move down a line.  They accept a numeric argument as a repeat
  80. count, unless otherwise specified.
  81.  
  82.    There are also special commands to use the buffer list to select
  83. another buffer, and to specify one or more other buffers for display
  84. in additional windows.
  85.  
  86. `1'
  87.      Select the buffer in a full-screen window.  This command takes
  88.      effect immediately.
  89.  
  90. `2'
  91.      Immediately set up two windows, with this buffer in one, and the
  92.      buffer selected before `*Buffer List*' in the other.
  93.  
  94. `f'
  95.      Immediately select the buffer in place of the `*Buffer List*'
  96.      buffer.
  97.  
  98. `o'
  99.      Immediately select the buffer in another window as if by `C-x 4
  100.      b', leaving `*Buffer List*' visible.
  101.  
  102. `q'
  103.      Immediately select this buffer, and display any buffers previously
  104.      flagged with the `m' command in other windows.  If there are no
  105.      buffers flagged with `m', this command is equivalent to `1'.
  106.  
  107. `m'
  108.      Flag this buffer to be displayed in another window if the `q'
  109.      command is used.  The request shows as a `>' at the beginning of
  110.      the line.  The same buffer may not have both a delete request and
  111.      a display request.
  112.  
  113.    Going back between a `buffer-menu' buffer and other Emacs buffers is
  114. easy.  You can, for example, switch from the `*Buffer List*' buffer to
  115. another Emacs buffer, and edit there.  You can then reselect the
  116. `buffer-menu' buffer, and perform operations already requested, or you
  117. can kill that buffer, or pay no further attention to it.   All that
  118. `buffer-menu' does directly is create and select a suitable buffer,
  119. and turn on Buffer Menu mode.  All the other capabilities of the
  120. buffer menu are implemented by special commands provided in Buffer
  121. Menu mode.
  122.  
  123.    The only difference between `buffer-menu' and `list-buffers' is
  124. that `buffer-menu' selects the `*Buffer List*' buffer and
  125. `list-buffers' does not.  If you run `list-buffers' (that is, type
  126. `C-x C-b') and select the buffer list manually, you can use all the
  127. commands described here.
  128.  
  129. 
  130. File: emacs,  Node: Windows,  Next: Major Modes,  Prev: Buffers,  Up: Top
  131.  
  132. Multiple Windows
  133. ****************
  134.  
  135.    Emacs can split the screen into two or many windows, which can
  136. display parts of different buffers, or different parts of one buffer. 
  137. If you are running Lucid GNU Emacs under X, that means you can have
  138. the X window that contains the Emacs screen have multiple subwindows.
  139.  
  140. * Menu:
  141.  
  142. * Basic Window::     Introduction to Emacs windows.
  143. * Split Window::     New windows are made by splitting existing windows.
  144. * Other Window::     Moving to another window or doing something to it.
  145. * Pop Up Window::    Finding a file or buffer in another window.
  146. * Change Window::    Deleting windows and changing their sizes.
  147.  
  148. 
  149. File: emacs,  Node: Basic Window,  Next: Split Window,  Prev: Windows,  Up: Windows
  150.  
  151. Concepts of Emacs Windows
  152. =========================
  153.  
  154.    When Emacs displays multiple windows, each window has one Emacs
  155. buffer designated for display.  The same buffer may appear in more
  156. than one window; if it does, any changes in its text are displayed in
  157. all the windows that display it.  Windows showing the same buffer can
  158. show different parts of it, because each window has its own value of
  159. point.
  160.  
  161.    At any time, one  windows is the "selected window"; the buffer 
  162. displayed by that window is the current buffer.  The cursor shows the
  163. location of point in that window.  Each other window has a location of
  164. point as well, but since the terminal has only one cursor it cannot
  165. show the location of point in the other windows.
  166.  
  167.    Commands to move point affect the value of point for the selected
  168. Emacs window only.  They do not change the value of point in any other
  169. Emacs window, including those showing the same buffer.  The same is
  170. true for commands such as `C-x b' to change the selected buffer in the
  171. selected window; they do not affect other windows at all.  However,
  172. there are other commands such as `C-x 4 b' that select a different
  173. window and switch buffers in it.  Also, all commands that display
  174. information in a window, including (for example) `C-h f'
  175. (`describe-function') and `C-x C-b' (`list-buffers'), work by
  176. switching buffers in a non-selected window without affecting the
  177. selected window.
  178.  
  179.    Each window has its own mode line, which displays the buffer name,
  180. modification status and major and minor modes of the buffer that is
  181. displayed in the window.  *Note Mode Line::, for details on the mode
  182. line.
  183.  
  184. 
  185. File: emacs,  Node: Split Window,  Next: Other Window,  Prev: Basic Window,  Up: Windows
  186.  
  187. Splitting Windows
  188. =================
  189.  
  190. `C-x 2'
  191.      Split the selected window into two windows, one above the other
  192.      (`split-window-vertically').
  193.  
  194. `C-x 5'
  195.      Split the selected window into two windows positioned side by side
  196.      (`split-window-horizontally').
  197.  
  198.      In Lucid GNU Emacs, horizontal window splitting is not
  199.      implemented.  In this version, `C-x 5' creates a new screen.
  200.  
  201. `C-x 6'
  202.      Save the current window configuration in register REG (a letter).
  203.  
  204. `C-x 7'
  205.      Restore (make current) the window configuration in register REG
  206.      (a letter).  Use with a register previously set with `C-x 6'.
  207.  
  208.    The command `C-x 2' (`split-window-vertically') breaks the selected
  209. window into two windows, one above the other.  Both windows start out
  210. displaying the same buffer, with the same value of point.  By default
  211. each of the two windows gets half the height of the window that was
  212. split.  A numeric argument specifies how many lines to give to the top
  213. window.
  214.  
  215.    `C-x 5' (`split-window-horizontally') breaks the selected window
  216. into two side-by-side windows.  A numeric argument specifies how many
  217. columns to give the one on the left.  A line of vertical bars
  218. separates the two windows.  Windows that are not the full width of the
  219. screen have truncated mode lines which do not always appear in inverse
  220. video, because Emacs display routines cannot display a region of
  221. inverse video that is only part of a line on the screen.
  222.  
  223.    When a window is less than the full width, many text lines are too
  224. long to fit.  Continuing all those lines might be confusing.  Set the
  225. variable `truncate-partial-width-windows' to non-`nil' to force
  226. truncation in all windows less than the full width of the screen,
  227. independent of the buffer and its value for `truncate-lines'.  *Note
  228. Continuation Lines::.
  229.  
  230.    Horizontal scrolling is often used in side-by-side windows.  *Note
  231. Display::.
  232.  
  233.    You can resize a window and store that configuration in a register
  234. by supplying a REGISTER argument to `register-to-window-config' (`C-x
  235. 6'). To return to the window configuration established with
  236. (`window-config-to-register', use `register-to-window-config' (`C-x
  237. 7').
  238.  
  239. 
  240. File: emacs,  Node: Other Window,  Next: Pop Up Window,  Prev: Split Window,  Up: Windows
  241.  
  242. Using Other Windows
  243. ===================
  244.  
  245. `C-x o'
  246.      Select another window (`other-window').  That is `o', not zero.
  247.  
  248. `C-M-v'
  249.      Scroll the next window (`scroll-other-window').
  250.  
  251. `M-x compare-windows'
  252.      Find the next place where the text in the selected window does
  253.      not match the text in the next window.
  254.  
  255. `M-x other-window-any-screen N'
  256.      Select the Nth different window on any screen.
  257.  
  258.    To select a different window, use `C-x o' (`other-window').  That
  259. is an `o', for `other', not a zero.  When there are more than two
  260. windows, the command moves through all the windows in a cyclic order,
  261. generally top to bottom and left to right.  From the rightmost and
  262. bottommost window, it goes back to the one at the upper left corner. 
  263. A numeric argument, N, moves several steps in the cyclic order of
  264. windows. A negative numeric argument moves around the cycle in the
  265. opposite order.  If the optional second argument ALL_SCREENS is
  266. non-`nil', the function cycles through all screens.  When the
  267. minibuffer is active, the minibuffer is the last window in the cycle;
  268. you can switch from the minibuffer window to one of the other windows,
  269. and later switch back and finish supplying the minibuffer argument that
  270. is requested.  *Note Minibuffer Edit::.
  271.  
  272.    The command `M-x other-window-any-screen' also selects the window N
  273. steps away in the cyclic order.  However, unlike `other-window', this
  274. command selects a window on the next or previous screen instead of
  275. wrapping around to the top or bottom of the current screen, when there
  276. are no more windows.
  277.  
  278.    The usual scrolling commands (*note Display::.) apply to the
  279. selected window only.  `C-M-v' (`scroll-other-window') scrolls the
  280. window that `C-x o' would select.  Like `C-v', it takes positive and
  281. negative arguments.
  282.  
  283.    The command `M-x compare-windows' compares the text in the current
  284. window with the text in the next window.  Comparison starts at point
  285. in each window.  Point moves forward in each window, a character at a
  286. time, until the next set of characters in the two windows are
  287. different.  Then the command is finished.
  288.  
  289.    A prefix argument IGNORE-WHITESPACE means ignore changes in
  290. whitespace.  The variable `compare-windows-whitespace' controls how
  291. whitespace is skipped.
  292.  
  293.    If `compare-ignore-case' is non-`nil', changes in case are also
  294. ignored.
  295.  
  296. 
  297. File: emacs,  Node: Pop Up Window,  Next: Change Window,  Prev: Other Window,  Up: Windows
  298.  
  299. Displaying in Another Window
  300. ============================
  301.  
  302.    `C-x 4' is a prefix key for commands that select another window
  303. (splitting the window if there is only one) and select a buffer in that
  304. window.  Different `C-x 4' commands have different ways of finding the
  305. buffer to select.
  306.  
  307. `C-x 4 b BUFNAME RET'
  308.      Select buffer BUFNAME in another window.  This runs
  309.      `switch-to-buffer-other-window'.
  310.  
  311. `C-x 4 f FILENAME RET'
  312.      Visit file FILENAME and select its buffer in another window.  This
  313.      runs `find-file-other-window'.  *Note Visiting::.
  314.  
  315. `C-x 4 d DIRECTORY RET'
  316.      Select a Dired buffer for directory DIRECTORY in another window. 
  317.      This runs `dired-other-window'.  *Note Dired::.
  318.  
  319. `C-x 4 m'
  320.      Start composing a mail message in another window.  This runs
  321.      `mail-other-window', and its same-window version is `C-x m'
  322.      (*note Sending Mail::.).
  323.  
  324. `C-x 4 .'
  325.      Find a tag in the current tag table in another window.  This runs
  326.      `find-tag-other-window', the multiple-window variant of `M-.'
  327.      (*note Tags::.).
  328.  
  329.    If the variable `display-buffer-function' is non-`nil', it is the
  330. function to call to handle display-buffer. It receives two arguments,
  331. the buffer and a flag, that if non-`nil', means that the currently
  332. selected window is not acceptable. Commands, such as
  333. `switch-to-buffer-other-window' and `find-file-other-window' work
  334. using this function.
  335.  
  336. 
  337. File: emacs,  Node: Change Window,  Prev: Pop Up Window,  Up: Windows
  338.  
  339. Deleting and Rearranging Windows
  340. ================================
  341.  
  342. `C-x 0'
  343.      Get rid of the selected window (`delete-window').  That is a zero. 
  344.      If there is more than one Emacs screen, deleting the sole
  345.      remaining window on that screen deletes the screen as well. If
  346.      the current screen is the only screen, it is not deleted.
  347.  
  348. `C-x 1'
  349.      Get rid of all windows except the selected one
  350.      (`delete-other-windows').
  351.  
  352. `C-x ^'
  353.      Make the selected window taller, at the expense of the other(s) 
  354.      (`enlarge-window').
  355.  
  356. `C-x }'
  357.      Make the selected window wider (`enlarge-window-horizontally').
  358.  
  359.    To delete a window, type `C-x 0' (`delete-window').  (That is a
  360. zero.)  The space occupied by the deleted window is distributed among
  361. the other active windows (but not the minibuffer window, even if that
  362. is active at the time).  Once a window is deleted, its attributes are
  363. forgotten; there is no automatic way to make another window of the
  364. same shape or showing the same buffer.  The buffer continues to exist,
  365. and you can select it in any window with `C-x b'.
  366.  
  367.    `C-x 1' (`delete-other-windows') is more powerful than `C-x 0'; it
  368. deletes all the windows except the selected one (and the minibuffer). 
  369. The selected window expands to use the whole screen except for the echo
  370. area.
  371.  
  372.    To readjust the division of space among existing windows, use `C-x
  373. ^' (`enlarge-window').  It makes the currently selected window longer
  374. by one line or as many lines as a numeric argument specifies.  With a
  375. negative argument, it makes the selected window smaller.  `C-x }'
  376. (`enlarge-window-horizontally') makes the selected window wider by the
  377. specified number of columns.  The extra screen space given to a window
  378. comes from one of its neighbors, if that is possible; otherwise, all
  379. the competing windows are shrunk in the same proportion.  If this
  380. makes some windows too small, those windows are deleted and their
  381. space is divided up.   Minimum window size is specified by the
  382. variables `window-min-height' and `window-min-width'.
  383.  
  384. 
  385. File: emacs,  Node: Major Modes,  Next: Indentation,  Prev: Windows,  Up: Top
  386.  
  387. Major Modes
  388. ***********
  389.  
  390.    Emacs has many different "major modes", each of which customizes
  391. Emacs for editing text of a particular sort.  The major modes are
  392. mutually exclusive;  at any time, each buffer has one major mode.  The
  393. mode line normally contains the name of the current major mode in
  394. parentheses.  *Note Mode Line::.
  395.  
  396.    The least specialized major mode is called "Fundamental mode".  This
  397. mode has no mode-specific redefinitions or variable settings.  Each
  398. Emacs command behaves in its most general manner, and each option is
  399. in its default state.  For editing any specific type of text, such as
  400. Lisp code or English text, you should switch to the appropriate major
  401. mode, such as Lisp mode or Text mode.
  402.  
  403.    Selecting a major mode changes the meanings of a few keys to become
  404. more specifically adapted to the language being edited.  TAB, DEL, and
  405. LFD are changed frequently.  In addition, commands which handle
  406. comments use the mode to determine how to delimit comments.  Many
  407. major modes redefine the syntactical properties of characters
  408. appearing in the buffer.  *Note Syntax::.
  409.  
  410.    The major modes fall into three major groups.  Lisp mode (which has
  411. several variants), C mode, and Muddle mode are for specific programming
  412. languages.  Text mode, Nroff mode, TeX mode and Outline mode are for
  413. editing English text.  The remaining major modes are not intended for
  414. use on users' files; they are used in buffers created by Emacs for
  415. specific purposes and include Dired mode for buffers made by Dired
  416. (*note Dired::.), Mail mode for buffers made by `C-x m' (*note Sending
  417. Mail::.), and Shell mode for buffers used for communicating with an
  418. inferior shell process (*note Interactive Shell::.).
  419.  
  420.    Most programming language major modes specify that only blank lines
  421. separate paragraphs.  This is so that the paragraph commands remain
  422. useful.  *Note Paragraphs::.  They also cause Auto Fill mode to use
  423. the definition of TAB to indent the new lines it creates.  This is
  424. because most lines in a program are usually indented.  *Note
  425. Indentation::.
  426.  
  427. * Menu:
  428.  
  429. * Choosing Modes::     How major modes are specified or chosen.
  430.  
  431. 
  432. File: emacs,  Node: Choosing Modes,  Prev: Major Modes,  Up: Major Modes
  433.  
  434. Choosing Major Modes
  435. ====================
  436.  
  437.    You can select a major mode explicitly for the current buffer, but
  438. most of the time Emacs determines which mode to use based on the file
  439. name or some text in the file.
  440.  
  441.    Use a `M-x' command to explicitly select a new major mode.  Add
  442. `-mode' to the name of a major mode to get the name of a command to
  443. select that mode.  For example, to enter Lisp mode, execute `M-x
  444. lisp-mode'.
  445.  
  446.    When you visit a file, Emacs usually chooses the right major mode
  447. based on the file's name.  For example, files whose names end in `.c'
  448. are edited in C mode.  The variable `auto-mode-alist' controls the
  449. correspondence between file names and major mode.  Its value is a list
  450. in which each element has the form
  451.  
  452.      (REGEXP . MODE-FUNCTION)
  453.  
  454. For example, one element normally found in the list has the form
  455. `("\\.c$" . c-mode)'. It is responsible for selecting C mode for files
  456. whose names end in `.c'.  (Note that `\\' is needed in Lisp syntax to
  457. include a `\' in the string, which is needed to suppress the special
  458. meaning of `.' in regexps.)  The only practical way to change this
  459. variable is with Lisp code.
  460.  
  461.    You can specify which major mode should be used for editing a
  462. certain file by a special sort of text in the first non-blank line of
  463. the file.  The mode name should appear in this line both preceded and
  464. followed by `-*-'.  Other text may appear on the line as well.  For
  465. example,
  466.  
  467.      ;-*-Lisp-*-
  468.  
  469. tells Emacs to use Lisp mode.  Note how the semicolon is used to make
  470. Lisp treat this line as a comment.  Such an explicit specification
  471. overrides any default mode based on the file name.
  472.  
  473.    Another format of mode specification is
  474.  
  475.      -*-Mode: MODENAME;-*-
  476.  
  477. which allows other things besides the major mode name to be specified. 
  478. However, Emacs does not look for anything except the mode name.
  479.  
  480.    The major mode can also be specified in a local variables list. 
  481. *Note File Variables::.
  482.  
  483.    When you visit a file that does not specify a major mode to use, or
  484. when you create a new buffer with `C-x b', Emacs uses the major mode
  485. specified by the variable `default-major-mode'.  Normally this value
  486. is the symbol `fundamental-mode', which specifies Fundamental mode. 
  487. If `default-major-mode' is `nil', the major mode is taken from the
  488. previously selected buffer.
  489.  
  490. 
  491. File: emacs,  Node: Indentation,  Next: Text,  Prev: Major Modes,  Up: Top
  492.  
  493. Indentation
  494. ***********
  495.  
  496. `TAB'
  497.      Indent current line "appropriately" in a mode-dependent fashion.
  498.  
  499. `LFD'
  500.      Perform RET followed by TAB (`newline-and-indent').
  501.  
  502. `M-^'
  503.      Merge two lines (`delete-indentation').  This would cancel out
  504.      the effect of LFD.
  505.  
  506. `C-M-o'
  507.      Split line at point; text on the line after point becomes a new
  508.      line indented to the same column that it now starts in
  509.      (`split-line').
  510.  
  511. `M-m'
  512.      Move (forward or back) to the first non-blank character on the
  513.      current line (`back-to-indentation').
  514.  
  515. `C-M-\'
  516.      Indent several lines to same column (`indent-region').
  517.  
  518. `C-x TAB'
  519.      Shift block of lines rigidly right or left (`indent-rigidly').
  520.  
  521. `M-i'
  522.      Indent from point to the next prespecified tab stop column
  523.      (`tab-to-tab-stop').
  524.  
  525. `M-x indent-relative'
  526.      Indent from point to under an indentation point in the previous
  527.      line.
  528.  
  529.    Most programming languages have some indentation convention.  For
  530. Lisp code, lines are indented according to their nesting in
  531. parentheses.  The same general idea is used for C code, though details
  532. differ.
  533.  
  534.    Use the TAB command to indent a line whatever the language, Each
  535. major mode defines this command to perform indentation appropriate for
  536. the particular language.  In Lisp mode, TAB aligns a line according to
  537. its depth in parentheses.  No matter where in the line you are when
  538. you type TAB, it aligns the line as a whole.  In C mode, TAB
  539. implements a subtle and sophisticated indentation style that knows
  540. about many aspects of C syntax.
  541.  
  542.    In Text mode, TAB runs the command `tab-to-tab-stop', which indents
  543. to the next tab stop column.  You can set the tab stops with `M-x
  544. edit-tab-stops'.
  545.  
  546. * Menu:
  547.  
  548. * Indentation Commands:: Various commands and techniques for indentation.
  549. * Tab Stops::            You can set arbitrary "tab stops" and then
  550.                          indent to the next tab stop when you want to.
  551. * Just Spaces::          You can request indentation using just spaces.
  552.  
  553. 
  554. File: emacs,  Node: Indentation Commands,  Next: Tab Stops,  Prev: Indentation,  Up: Indentation
  555.  
  556. Indentation Commands and Techniques
  557. ===================================
  558.  
  559.    If you just want to insert a tab character in the buffer, you can
  560. type `C-q TAB'.
  561.  
  562.    To move over the indentation on a line, type `Meta-m'
  563. (`back-to-indentation').  This command, given anywhere on a line,
  564. positions point at the first non-blank character on the line.
  565.  
  566.    To insert an indented line before the current line, type `C-a C-o
  567. TAB'.  To make an indented line after the current line, use `C-e LFD'.
  568.  
  569.    `C-M-o' (`split-line') moves the text from point to the end of the
  570. line vertically down, so that the current line becomes two lines. 
  571. `C-M-o' first moves point forward over any spaces and tabs.  Then it
  572. inserts after point a newline and enough indentation to reach the same
  573. column point is on.  Point remains before the inserted newline; in this
  574. regard, `C-M-o' resembles `C-o'.
  575.  
  576.    To join two lines cleanly, use the `Meta-^' (`delete-indentation')
  577. command to delete the indentation at the front of the current line,
  578. and the line boundary as well.  Empty spaces are replaced by a single
  579. space, or by no space if at the beginning of a line, before a `)', or
  580. after a `('.  To delete just the indentation of a line, go to the
  581. beginning of the line and use `Meta-\' (`delete-horizontal-space'),
  582. which deletes all spaces and tabs around the cursor.
  583.  
  584.    There are also commands for changing the indentation of several
  585. lines at once.  `Control-Meta-\' (`indent-region') gives each line
  586. which begins in the region the "usual" indentation by invoking TAB at
  587. the beginning of the line.  A numeric argument specifies the column to
  588. indent to.  Each line is shifted left or right so that its first
  589. non-blank character appears in that column.  `C-x TAB'
  590. (`indent-rigidly') moves all the lines in the region right by its
  591. argument (left, for negative arguments).  The whole group of lines
  592. moves rigidly sideways, which is how the command gets its name.
  593.  
  594.    `M-x indent-relative' indents at point based on the previous line
  595. (actually, the last non-empty line.)  It inserts whitespace at point,
  596. moving point, until it is underneath an indentation point in the
  597. previous line.  An indentation point is the end of a sequence of
  598. whitespace or the end of the line.  If point is farther right than any
  599. indentation point in the previous line, the whitespace before point is
  600. deleted and the first indentation point then applicable is used.  If
  601. no indentation point is applicable even then, `tab-to-tab-stop' is run
  602. (see next section).
  603.  
  604.    `indent-relative' is the definition of TAB in Indented Text mode. 
  605. *Note Text::.
  606.  
  607. 
  608. File: emacs,  Node: Tab Stops,  Next: Just Spaces,  Prev: Indentation Commands,  Up: Indentation
  609.  
  610. Tab Stops
  611. =========
  612.  
  613.    For typing in tables, you can use Text mode's definition of TAB,
  614. `tab-to-tab-stop'.  This command inserts indentation before point,
  615. enough to reach the next tab stop column.  Even if you are not in Text
  616. mode, this function is associated with `M-i' anyway.
  617.  
  618.    You can arbitrarily set the tab stops used by `M-i'.  They are
  619. stored as a list of column-numbers in increasing order in the variable
  620. `tab-stop-list'.
  621.  
  622.    The convenient way to set the tab stops is using `M-x
  623. edit-tab-stops', which creates and selects a buffer containing a
  624. description of the tab stop settings.  You can edit this buffer to
  625. specify different tab stops, and then type `C-c C-c' to make those new
  626. tab stops take effect.  In the tab stop buffer, `C-c C-c' runs the
  627. function `edit-tab-stops-note-changes' rather than the default
  628. `save-buffer'.  `edit-tab-stops' records which buffer was current when
  629. you invoked it, and stores the tab stops in that buffer.  Normally all
  630. buffers share the same tab stops and changing them in one buffer
  631. affects all.  If you make `tab-stop-list' local in one buffer
  632. `edit-tab-stops' in that buffer edits only the local settings.
  633.  
  634.    Here is the text representing ordinary tab stops every eight
  635. columns.
  636.  
  637.              :       :       :       :       :       :
  638.      0         1         2         3         4
  639.      0123456789012345678901234567890123456789012345678
  640.      To install changes, type C-c C-c
  641.  
  642.    The first line contains a colon at each tab stop.  The remaining
  643. lines help you see where the colons are and tell you what to do.
  644.  
  645.    Note that the tab stops that control `tab-to-tab-stop' have nothing
  646. to do with displaying tab characters in the buffer.  *Note Display
  647. Vars::, for more information on that.
  648.  
  649. 
  650. File: emacs,  Node: Just Spaces,  Prev: Tab Stops,  Up: Indentation
  651.  
  652. Tabs vs. Spaces
  653. ===============
  654.  
  655.    Emacs normally uses both tabs and spaces to indent lines.  If you
  656. prefer, all indentation can be made from spaces only.  To request
  657. this, set `indent-tabs-mode' to `nil'.  This is a per-buffer variable;
  658. altering the variable affects only the current buffer, but there is a
  659. default value which you can change as well.  *Note Locals::.
  660.  
  661.    There are also commands to convert tabs to spaces or vice versa,
  662. always preserving the columns of all non-blank text.  `M-x tabify'
  663. scans the region for sequences of spaces, and converts sequences of at
  664. least three spaces to tabs if that is possible without changing
  665. indentation.  `M-x untabify' changes all tabs in the region to
  666. corresponding numbers of spaces.
  667.  
  668. 
  669. File: emacs,  Node: Text,  Next: Programs,  Prev: Indentation,  Up: Top
  670.  
  671. Commands for Human Languages
  672. ****************************
  673.  
  674.    The term "text" has two widespread meanings in our area of the
  675. computer field.  One is data that is a sequence of characters.  In this
  676. sense of the word any file that you edit with Emacs is text.  The other
  677. meaning is more restrictive: a sequence of characters in a human
  678. language for humans to read (possibly after processing by a text
  679. formatter), as opposed to a program or commands for a program.
  680.  
  681.    Human languages have syntactic and stylistic conventions that editor
  682. commands should support or use to advantage: conventions involving
  683. words, sentences, paragraphs, and capital letters.  This chapter
  684. describes Emacs commands for all these things.  There are also
  685. commands for "filling", or rearranging paragraphs into lines of
  686. approximately equal length.  The commands for moving over and killing
  687. words, sentences and paragraphs, while intended primarily for editing
  688. text, are also often useful for editing programs.
  689.  
  690.    Emacs has several major modes for editing human language text.  If
  691. a file contains plain text, use Text mode, which customizes Emacs in
  692. small ways for the syntactic conventions of text.  For text which
  693. contains embedded commands for text formatters, Emacs has other major
  694. modes, each for a particular text formatter.  Thus, for input to TeX,
  695. you can use TeX mode; for input to nroff, Nroff mode.
  696.  
  697. * Menu:
  698.  
  699. * Text Mode::   The major modes for editing text files.
  700. * Nroff Mode::  The major mode for editing input to the formatter nroff.
  701. * TeX Mode::    The major modes for editing input to the formatter TeX.
  702. * Outline Mode::The major mode for editing outlines.
  703. * Words::       Moving over and killing words.
  704. * Sentences::   Moving over and killing sentences.
  705. * Paragraphs::    Moving over paragraphs.
  706. * Pages::    Moving over pages.
  707. * Filling::     Filling or justifying text
  708. * Case::        Changing the case of text
  709.  
  710. 
  711. File: emacs,  Node: Text Mode,  Next: Words,  Prev: Text,  Up: Text
  712.  
  713. Text Mode
  714. =========
  715.  
  716.    You should use Text mode--rather than Fundamental or Lisp mode--to
  717. edit files of text in a human language.  Invoke `M-x text-mode' to
  718. enter Text mode.  In Text mode, TAB runs the function
  719. `tab-to-tab-stop', which allows you to use arbitrary tab stops set
  720. with `M-x edit-tab-stops' (*note Tab Stops::.).  Features concerned
  721. with comments in programs are turned off unless they are explicitly
  722. invoked.  The syntax table is changed so that periods are not
  723. considered part of a word, while apostrophes, backspaces and
  724. underlines are.
  725.  
  726.    A similar variant mode is Indented Text mode, intended for editing
  727. text in which most lines are indented.  This mode defines TAB to run
  728. `indent-relative' (*note Indentation::.), and makes Auto Fill indent
  729. the lines it creates.  As a result, a line made by Auto Filling, or by
  730. LFD, is normally indented just like the previous line.  Use `M-x
  731. indented-text-mode' to select this mode.
  732.  
  733.    Entering Text mode or Indented Text mode calls the value of the
  734. variable `text-mode-hook' with no arguments, if that value exists and
  735. is not `nil'.  This value is also called when modes related to Text
  736. mode are entered; this includes Nroff mode, TeX mode, Outline mode and
  737. Mail mode.  Your hook can look at the value of `major-mode' to see
  738. which of these modes is actually being entered.
  739.  
  740.    Two modes similar to Text mode are of use for editing text that is
  741. to be passed through a text formatter before achieving the form in
  742. which humans are to read it.
  743.  
  744. * Menu:
  745.  
  746. * Nroff Mode::  The major mode for editing input to the formatter nroff.
  747. * TeX Mode::    The major modes for editing input to the formatter TeX.
  748.  
  749.  
  750.   Another similar mode is used for editing outlines.  It allows you
  751. to view the text at various levels of detail.  You can view either
  752. the outline headings alone or both headings and text; you can also
  753. hide some of the headings at lower levels from view to make the high
  754. level structure more visible.
  755.  
  756.  
  757. * Outline Mode::The major mode for editing outlines.
  758.  
  759. 
  760. File: emacs,  Node: Nroff Mode,  Next: TeX Mode,  Prev: Text Mode,  Up: Text Mode
  761.  
  762. Nroff Mode
  763. ----------
  764.  
  765.    Nroff mode is a mode like Text mode but modified to handle nroff
  766. commands present in the text.  Invoke `M-x nroff-mode' to enter this
  767. mode.  Nroff mode differs from Text mode in only a few ways.  All nroff
  768. command lines are considered paragraph separators, so that filling
  769. never garbles the nroff commands.  Pages are separated by `.bp'
  770. commands.  Comments start with backslash-doublequote.  There are also
  771. three special commands that are not available in Text mode:
  772.  
  773. `M-n'
  774.      Move to the beginning of the next line that isn't an nroff command
  775.      (`forward-text-line').  An argument is a repeat count.
  776.  
  777. `M-p'
  778.      Like `M-n' but move up (`backward-text-line').
  779.  
  780. `M-?'
  781.      Prints in the echo area the number of text lines (lines that are
  782.      not nroff commands) in the region (`count-text-lines').
  783.  
  784.    The other feature of Nroff mode is that you can turn on Electric
  785. Nroff newline mode.  This is a minor mode that you can turn on or off
  786. with `M-x electric-nroff-mode' (*note Minor Modes::.).  When the mode
  787. is on and you use RET to end a line that containing an nroff command
  788. that opens a kind of grouping, Emacs automatically inserts the matching
  789. nroff command to close that grouping on the following line.  For
  790. example, if you are at the beginning of a line and type `. ( b RET',
  791. the matching command `.)b' will be inserted on a new line following
  792. point.
  793.  
  794.    Entering Nroff mode calls the value of the variable
  795. `text-mode-hook' with no arguments, if that value exists and is not
  796. `nil'; then does the same with the variable `nroff-mode-hook'.
  797.  
  798. 
  799. File: emacs,  Node: TeX Mode,  Next: Outline Mode,  Prev: Nroff Mode,  Up: Text Mode
  800.  
  801. TeX Mode
  802. --------
  803.  
  804.    TeX is a powerful text formatter written by Donald Knuth; like GNU
  805. Emacs, it is free.  LaTeX is a simplified input format for TeX,
  806. implemented by TeX macros.  It is part of TeX.
  807.  
  808.    Emacs has a special TeX mode for editing TeX input files.  It
  809. provides facilities for checking the balance of delimiters and for
  810. invoking TeX on all or part of the file.
  811.  
  812.    TeX mode has two variants, Plain TeX mode and LaTeX mode, which are
  813. two distinct major modes that differ only slightly.  These modes are
  814. designed for editing the two different input formats.  The command
  815. `M-x tex-mode' looks at the contents of a buffer to determine whether
  816. it appears to be LaTeX input or not; it then selects the appropriate
  817. mode.  If it can't tell which is right (e.g., the buffer is empty),
  818. the variable `TeX-default-mode' controls which mode is used.
  819.  
  820.    The commands `M-x plain-tex-mode' and `M-x latex-mode' explicitly
  821. select one of the variants of TeX mode.  Use these commands when `M-x
  822. tex-mode' does not guess right.
  823.  
  824. * Menu:
  825.  
  826. * Editing: TeX Editing.   Special commands for editing in TeX mode.
  827. * Printing: TeX Print.    Commands for printing part of a file with TeX.
  828.  
  829.    TeX for Unix systems can be obtained from the University of
  830. Washington for a distribution fee.
  831.  
  832.    To order a full distribution, send $140.00 for a 1/2 inch 9-track
  833. tape, $165.00 for two 4-track 1/4 inch cartridge tapes (foreign sites
  834. $150.00, for 1/2 inch, $175.00 for 1/4 inch, to cover the extra
  835. postage) payable to the University of Washington to:
  836.  
  837.      The Director
  838.      Northwest Computer Support Group,  DW-10
  839.      University of Washington
  840.      Seattle, Washington 98195
  841.  
  842. Purchase orders are acceptable, but there is an extra charge of
  843. $10.00, to pay for processing charges. (Total of $150 for domestic
  844. sites, $175 for foreign sites).
  845.  
  846.    The normal distribution is a tar tape, blocked 20, 1600 bpi, on an
  847. industry standard 2400 foot half-inch reel.  The physical format for
  848. the 1/4 inch streamer cartridges uses QIC-11, 8000 bpi, 4-track
  849. serpentine recording for the SUN.  Also, SystemV tapes can be written
  850. in cpio format, blocked 5120 bytes, ASCII headers.
  851.  
  852. 
  853. File: emacs,  Node: TeX Editing,  Next: TeX Print,  Prev: TeX Mode,  Up: TeX Mode
  854.  
  855. TeX Editing Commands
  856. ....................
  857.  
  858.    Here are the special commands provided in TeX mode for editing the
  859. text of the file.
  860.  
  861. `"'
  862.      Insert, according to context, either ```' or `"' or `'''
  863.      (`TeX-insert-quote').
  864.  
  865. `LFD'
  866.      Insert a paragraph break (two newlines) and check the previous
  867.      paragraph for unbalanced braces or dollar signs (`TeX-terminate-
  868.      paragraph').
  869.  
  870. `M-x validate-TeX-buffer'
  871.      Check each paragraph in the buffer for unbalanced braces or
  872.      dollar signs.
  873.  
  874. `M-{'
  875.      Insert `{}' and position point between them (`TeX-insert-braces').
  876.  
  877. `M-}'
  878.      Move forward past the next unmatched close brace (`up-list').
  879.  
  880. `C-c C-f'
  881.      Close a block for LaTeX (`TeX-close-LaTeX-block').
  882.  
  883.    In TeX, the character `"' is not normally used; you use `"' to
  884. start a quotation and `"' to end one.  TeX mode defines the key `"' to
  885. insert `"' after whitespace or an open brace, `"' after a backslash,
  886. or `"' otherwise.  This is done by the command `TeX-insert-quote'.  If
  887. you need the character `"' itself in unusual contexts, use `C-q' to
  888. insert it.  Also, `"' with a numeric argument always inserts that
  889. number of `"' characters.
  890.  
  891.    In TeX mode, `$' has a special syntax code which attempts to
  892. understand the way TeX math mode delimiters match.  When you insert a
  893. `$' that is meant to exit math mode, the position of the matching `$'
  894. that entered math mode is displayed for a second.  This is the same
  895. feature that displays the open brace that matches a close brace that
  896. is inserted.  However, there is no way to tell whether a `$' enters
  897. math mode or leaves it; so when you insert a `$' that enters math
  898. mode, the previous `$' position is shown as if it were a match, even
  899. though they are actually unrelated.
  900.  
  901.    If you prefer to keep braces balanced at all times, you can use
  902. `M-{' (`TeX-insert-braces') to insert a pair of braces.  It leaves
  903. point between the two braces so you can insert the text that belongs
  904. inside.  Afterward, use the command `M-}' (`up-list') to move forward
  905. past the close brace.
  906.  
  907.    There are two commands for checking the matching of braces.  LFD
  908. (`TeX-terminate-paragraph') checks the paragraph before point, and
  909. inserts two newlines to start a new paragraph.  It prints a message in
  910. the echo area if any mismatch is found.  `M-x validate-TeX-buffer'
  911. checks the entire buffer, paragraph by paragraph.  When it finds a
  912. paragraph that contains a mismatch, it displays point at the beginning
  913. of the paragraph for a few seconds and pushes a mark at that spot. 
  914. Scanning continues until the whole buffer has been checked or until
  915. you type another key.  The positions of the last several paragraphs
  916. with mismatches can be found in the mark ring (*note Mark Ring::.).
  917.  
  918.    Note that square brackets and parentheses, not just braces, are
  919. matched in TeX mode.  This is wrong if you want to  check TeX syntax. 
  920. However, parentheses and square brackets are likely to be used in text
  921. as matching delimiters and it is useful for the various motion
  922. commands and automatic match display to work with them.
  923.  
  924.    In LaTeX input, `\begin' and `\end' commands must balance.  After
  925. you insert a `\begin', use `C-c C-f' (`TeX-close-LaTeX-block') to
  926. insert automatically a matching `\end' (on a new line following the
  927. `\begin').  A blank line is inserted between the two, and point is
  928. left there.
  929.  
  930. 
  931. File: emacs,  Node: TeX Print,  Prev: TeX Editing,  Up: TeX Mode
  932.  
  933. TeX Printing Commands
  934. .....................
  935.  
  936.    You can invoke TeX as an inferior of Emacs on either the entire
  937. contents of the buffer or just a region at a time.  Running TeX in
  938. this way on just one chapter is a good way to see what your changes
  939. look like without taking the time to format the entire file.
  940.  
  941. `C-c C-r'
  942.      Invoke TeX on the current region, plus the buffer's header
  943.      (`TeX-region').
  944.  
  945. `C-c C-b'
  946.      Invoke TeX on the entire current buffer (`TeX-buffer').
  947.  
  948. `C-c C-l'
  949.      Recenter the window showing output from the inferior TeX so that
  950.      the last line can be seen (`TeX-recenter-output-buffer').
  951.  
  952. `C-c C-k'
  953.      Kill the inferior TeX (`TeX-kill-job').
  954.  
  955. `C-c C-p'
  956.      Print the output from the last `C-c C-r' or `C-c C-b' command
  957.      (`TeX-print').
  958.  
  959. `C-c C-q'
  960.      Show the printer queue (`TeX-show-print-queue').
  961.  
  962.    You can pass the current buffer through an inferior TeX using `C-c
  963. C-b' (`TeX-buffer').  The formatted output appears in a file in
  964. `/tmp'; to print it, type `C-c C-p' (`TeX-print').  Afterward use `C-c
  965. C-q' (`TeX-show-print-queue') to view the progress of your output
  966. towards being printed.
  967.  
  968.    The console output from TeX, including any error messages, appears
  969. in a buffer called `*TeX-shell*'.  If TeX gets an error, you can switch
  970. to this buffer and feed it input (this works as in Shell mode; *note
  971. Interactive Shell::.).  Without switching to this buffer, you can
  972. scroll it so that its last line is visible by typing `C-c C-l'.
  973.  
  974.    Type `C-c C-k' (`TeX-kill-job') to kill the TeX process if you see
  975. that its output is no longer useful.  Using `C-c C-b' or `C-c C-r'
  976. also kills any TeX process still running.
  977.  
  978.    You can pass an arbitrary region through an inferior TeX by typing
  979. `C-c C-r' (`TeX-region').  This is tricky, however, because most files
  980. of TeX input contain commands at the beginning to set parameters and
  981. define macros.  Without them, no later part of the file will format
  982. correctly.  To solve this problem, `C-c C-r' allows you to designate a
  983. part of the file as containing essential commands; it is included
  984. before the specified region as part of the input to TeX.  The
  985. designated part of the file is called the "header".
  986.  
  987.    To indicate the bounds of the header in Plain TeX mode, insert two
  988. special strings in the file: `%**start of header' before the header,
  989. and `%**end of header' after it.  Each string must appear entirely on
  990. one line, but there may be other text on the line before or after. 
  991. The lines containing the two strings are included in the header.  If
  992. `%**start of header' does not appear within the first 100 lines of the
  993. buffer, `C-c C-r' assumes there is no header.
  994.  
  995.    In LaTeX mode, the header begins with `\documentstyle' and ends
  996. with 
  997. `\begin{document}'.  These are commands that LaTeX requires you to
  998. use, so you don't need to do anything special to identify the header.
  999.  
  1000.    When you enter either kind of TeX mode, Emacs calls with no
  1001. arguments the value of the variable `text-mode-hook', if that value
  1002. exists and is not `nil'.  Emacs then calls the variable
  1003. `TeX-mode-hook' and either `plain-TeX-mode-hook' or `LaTeX-mode-hook'
  1004. under the same conditions.
  1005.  
  1006. 
  1007. File: emacs,  Node: Outline Mode,  Prev: TeX Mode,  Up: Text Mode
  1008.  
  1009. Outline Mode
  1010. ------------
  1011.  
  1012.    Outline mode is a major mode similar to Text mode but intended for
  1013. editing outlines.  It allows you to make parts of the text temporarily
  1014. invisible so that you can see just the overall structure of the
  1015. outline.  Type `M-x outline-mode' to turn on Outline mode in the
  1016. current buffer.
  1017.  
  1018.    When you enter Outline mode, Emacs calls with no arguments the value
  1019. of the variable `text-mode-hook', if that value exists and is not
  1020. `nil'; then it does the same with the variable `outline-mode-hook'.
  1021.  
  1022.    When a line is invisible in outline mode, it does not appear on the
  1023. screen.  The screen appears exactly as if the invisible line were
  1024. deleted, except that an ellipsis (three periods in a row) appears at
  1025. the end of the previous visible line (only one ellipsis no matter how
  1026. many invisible lines follow).
  1027.  
  1028.    All editing commands treat the text of the invisible line as part
  1029. of the previous visible line.  For example, `C-n' moves onto the next
  1030. visible line.  Killing an entire visible line, including its
  1031. terminating newline, really kills all the following invisible lines as
  1032. well; yanking everything back yanks the invisible lines and they
  1033. remain invisible.
  1034.  
  1035. * Menu:
  1036.  
  1037. * Format: Outline Format.      What the text of an outline looks like.
  1038. * Motion: Outline Motion.      Special commands for moving through outlines.
  1039. * Visibility: Outline Visibility. Commands to control what is visible.
  1040.  
  1041. 
  1042. File: emacs,  Node: Outline Format,  Next: Outline Motion,  Prev: Outline Mode,  Up: Outline Mode
  1043.  
  1044. Format of Outlines
  1045. ..................
  1046.  
  1047.    Outline mode assumes that the lines in the buffer are of two types:
  1048. "heading lines" and "body lines".  A heading line represents a topic
  1049. in the outline.  Heading lines start with one or more stars; the
  1050. number of stars determines the depth of the heading in the outline
  1051. structure.  Thus, a heading line with one star is a major topic; all
  1052. the heading lines with two stars between it and the next one-star
  1053. heading are its subtopics; and so on.  Any line that is not a heading
  1054. line is a body line.  Body lines belong to the preceding heading line.
  1055.  Here is an example:
  1056.  
  1057.      * Food
  1058.      
  1059.      This is the body,
  1060.      which says something about the topic of food.
  1061.      
  1062.      ** Delicious Food
  1063.      
  1064.      This is the body of the second-level header.
  1065.      
  1066.      ** Distasteful Food
  1067.      
  1068.      This could have
  1069.      a body too, with
  1070.      several lines.
  1071.      
  1072.      *** Dormitory Food
  1073.      
  1074.      * Shelter
  1075.      
  1076.      A second first-level topic with its header line.
  1077.  
  1078.    A heading line together with all following body lines is called
  1079. collectively an "entry".  A heading line together with all following
  1080. deeper heading lines and their body lines is called a "subtree".
  1081.  
  1082.    You can customize the criterion for distinguishing heading lines by
  1083. setting the variable `outline-regexp'.  Any line whose beginning has a
  1084. match for this regexp is considered a heading line.  Matches that
  1085. start within a line (not at the beginning) do not count.  The length of
  1086. the matching text determines the level of the heading; longer matches
  1087. make a more deeply nested level.  Thus, for example, if a text
  1088. formatter has commands `@chapter', `@section' and `@subsection' to
  1089. divide the document into chapters and sections, you can make those
  1090. lines count as heading lines by setting `outline-regexp' to
  1091. `"@chap\\|@\\(sub\\)*section"'.  Note the trick: the two words
  1092. `chapter' and `section' are the same length, but by defining the
  1093. regexp to match only `chap' we ensure that the length of the text
  1094. matched on a chapter heading is shorter, so that Outline mode will
  1095. know that sections are contained in chapters.  This works as long as no
  1096. other command starts with `@chap'.
  1097.  
  1098.    Outline mode makes a line invisible by changing the newline before
  1099. it into an ASCII Control-M (code 015).  Most editing commands that
  1100. work on lines treat an invisible line as part of the previous line
  1101. because, strictly speaking, it is part of that line, since there is no
  1102. longer a newline in between.  When you save the file in Outline mode,
  1103. Control-M characters are saved as newlines, so the invisible lines
  1104. become ordinary lines in the file.  Saving does not change the
  1105. visibility status of a line inside Emacs.
  1106.  
  1107. 
  1108. File: emacs,  Node: Outline Motion,  Next: Outline Visibility,  Prev: Outline Format,  Up: Outline Mode
  1109.  
  1110. Outline Motion Commands
  1111. .......................
  1112.  
  1113.    Some special commands in Outline mode move backward and forward to
  1114. heading lines.
  1115.  
  1116. `C-c C-n'
  1117.      Move point to the next visible heading line
  1118.      (`outline-next-visible-heading').
  1119.  
  1120. `C-c C-p'
  1121.      Move point to the previous visible heading line 
  1122.       (`outline-previous-visible-heading').
  1123.  
  1124. `C-c C-f'
  1125.      Move point to the next visible heading line at the same level as
  1126.      the one point is on (`outline-forward-same-level').
  1127.  
  1128. `C-c C-b'
  1129.      Move point to the previous visible heading line at the same level
  1130.      (`outline-backward-same-level').
  1131.  
  1132. `C-c C-u'
  1133.      Move point up to a lower-level (more inclusive) visible heading
  1134.      line (`outline-up-heading').
  1135.  
  1136.    `C-c C-n' (`next-visible-heading') moves down to the next heading
  1137. line.  `C-c C-p' (`previous-visible-heading') moves similarly
  1138. backward.  Both accept numeric arguments as repeat counts.  The names
  1139. emphasize that invisible headings are skipped, but this is not really
  1140. a special feature.  All editing commands that look for lines ignore the
  1141. invisible lines automatically.
  1142.  
  1143.    More advanced motion commands understand the levels of headings. 
  1144. The commands `C-c C-f' (`outline-forward-same-level') and `C-c C-b'
  1145. (`outline-backward-same-level') move from one heading line to another
  1146. visible heading at the same depth in the outline.  `C-c C-u'
  1147. (`outline-up-heading') moves backward to another heading that is less
  1148. deeply nested.
  1149.  
  1150. 
  1151. File: emacs,  Node: Outline Visibility,  Prev: Outline Motion,  Up: Outline Mode
  1152.  
  1153. Outline Visibility Commands
  1154. ...........................
  1155.  
  1156.    The other special commands of outline mode are used to make lines
  1157. visible or invisible.  Their names all start with `hide' or `show'. 
  1158. Most of them exist as pairs of opposites.  They are not undoable;
  1159. instead, you can undo right past them.  Making lines visible or
  1160. invisible is simply not recorded by the undo mechanism.
  1161.  
  1162. `M-x hide-body'
  1163.      Make all body lines in the buffer invisible.
  1164.  
  1165. `M-x show-all'
  1166.      Make all lines in the buffer visible.
  1167.  
  1168. `C-c C-h'
  1169.      Make everything under this heading invisible, not including this
  1170.      heading itself (`hide-subtree').
  1171.  
  1172. `C-c C-s'
  1173.      Make everything under this heading visible, including body,
  1174.      subheadings, and their bodies (`show-subtree').
  1175.  
  1176. `M-x hide-leaves'
  1177.      Make the body of this heading line, and of all its subheadings,
  1178.      invisible.
  1179.  
  1180. `M-x show-branches'
  1181.      Make all subheadings of this heading line, at all levels, visible.
  1182.  
  1183. `C-c C-i'
  1184.      Make immediate subheadings (one level down) of this heading line
  1185.      visible (`show-children').
  1186.  
  1187. `M-x hide-entry'
  1188.      Make this heading line's body invisible.
  1189.  
  1190. `M-x show-entry'
  1191.      Make this heading line's body visible.
  1192.  
  1193.    Two commands that are exact opposites are `M-x hide-entry' and `M-x
  1194. show-entry'.  They are used with point on a heading line, and apply
  1195. only to the body lines of that heading.  The subtopics and their
  1196. bodies are not affected.
  1197.  
  1198.    Two more powerful opposites are `C-c C-h' (`hide-subtree') and `C-c
  1199. C-s' (`show-subtree').  Both should be used when point is on a heading
  1200. line, and both apply to all the lines of that heading's "subtree": its
  1201. body, all its subheadings, both direct and indirect, and all of their
  1202. bodies.  In other words, the subtree contains everything following
  1203. this heading line, up to and not including the next heading of the
  1204. same or higher rank.
  1205.  
  1206.    Intermediate between a visible subtree and an invisible one is
  1207. having all the subheadings visible but none of the body.  There are
  1208. two commands for doing this, one that hides the bodies and one that
  1209. makes the subheadings visible.  They are `M-x hide-leaves' and `M-x
  1210. show-branches'.
  1211.  
  1212.    A little weaker than `show-branches' is `C-c C-i'
  1213. (`show-children').  It makes just the direct subheadings
  1214. visible--those one level down.  Deeper subheadings remain invisible.
  1215.  
  1216.    Two commands have a blanket effect on the whole file.  `M-x
  1217. hide-body' makes all body lines invisible, so that you see just the
  1218. outline structure.  `M-x show-all' makes all lines visible.  You can
  1219. think of these commands as a pair of opposites even though `M-x
  1220. show-all' applies to more than just body lines.
  1221.  
  1222.    You can turn off the use of ellipses at the ends of visible lines by
  1223. setting `selective-display-ellipses' to `nil'.  The result is no
  1224. visible indication of the presence of invisible lines.
  1225.  
  1226.